package chapter02;

public class chapter49 {

    public static void main(String[] args) {
                int n = 0, m, j, i;
                System.out.print("2");
                label: for (i = 3; i <= 100; i += 2) {  //i是主角
                    m = (int) Math.sqrt((double) i);   // m是i的平方根
                    for (j = 2; j <= m; j++) {         // j <= i的平方根
                        if ((i % j) == 0) { break; }
                        if (i == 51) { break label; }
                    }
                    if (j >= m + 1) {   //如果j大于i的平方根+1
                        if (n % 6 == 0) { System.out.println("\n"); }
                        System.out.print(i + "  ");
                        n++;
                    }
                }

    }
}
